﻿var yun1 ="#fUI/UIWindow/Quest/icon7/10#";////红色圆
var yun2 ="#fUI/UIWindow/Quest/icon8/0#";////蓝指标
var yun4 ="#fUI/UIWindow/Quest/reward#";////奖励
var ppp = "#fEffect/CharacterEff/1112907/4/0#"; //泡炮
var zs = "#fEffect/CharacterEff/1112946/2/0#";  //砖石粉
var zs1 = "#fEffect/CharacterEff/1112946/1/1#";  //砖石蓝
var a = "#fEffect/CharacterEff/1082565/0/0#";  //饼干兔子
var b = "#fEffect/CharacterEff/1112904/0/0#"; //彩色星星
var c = "#fEffect/CharacterEff/1003271/0/0#";  //红色心心
var d = "#fEffect/CharacterEff/1112946/4/1#";  //钻石
var e = "#fEffect/CharacterEff/1082229/0/0#";  //红心
var eff = "#fEffect/CharacterEff/1112905/0/1#"; //
var epp = "#fEffect/CharacterEff/1082312/0/0#";  //彩光
var epp1 = "#fEffect/CharacterEff/1082312/2/0#"; //彩光1
var axx = "#fEffect/CharacterEff/1051294/0/0#";  //爱心
var xxx = "#fEffect/CharacterEff/1082565/2/0#"; //星系
var ppp = "#fEffect/CharacterEff/1112907/4/0#"; //泡炮 
var epp3 = "#fEffect/CharacterEff/1112908/0/1#";  //彩光3
var axx1 = "#fEffect/CharacterEff/1062114/1/0#";  //爱心
var zs = "#fEffect/CharacterEff/1112946/2/0#";  //砖石粉
var zs1 = "#fEffect/CharacterEff/1112946/1/1#";  //砖石蓝
var dxxx = "#fEffect/CharacterEff/1102232/2/0#"; //星系
var tz1 = "#fEffect/CharacterEff/1082565/2/0#";  //兔子蓝
var tz = "#fEffect/CharacterEff/1082565/4/0#";  //兔子粉
var tz5 = "#fUI/UIWindow2.img/QuestAlarm/BtQ/normal/0#";
var iconEvent = "#fUI/UIToolTip.img/Item/Equip/Star/Star#";
var ttt2 ="#fUI/UIWindow/Quest/icon6/7#";////美化2
var tz2 = "#fEffect/CharacterEff/1082565/0/0#";  //兔子灰色
var tz3 = "#fEffect/CharacterEff/1082588/0/0#";  //红点
var tz4 = "#fEffect/CharacterEff/1082588/3/0#";  //蓝点
var tz51 = "#fEffect/CharacterEff/1082588/1/0#";  //绿点
var tz6 = "#fEffect/CharacterEff/1112900/2/1#";  //音符蓝
var tz7 = "#fEffect/CharacterEff/1112900/3/1#";  //音符红
var tz8 = "#fEffect/CharacterEff/1112900/4/1#";  //音符绿
var tz88 = "#fEffect/CharacterEff/1112900/5/1#";  //音符绿!
var tz9 = "#fEffect/CharacterEff/1112902/0/0#";  //蓝心
var tz10 = "#fEffect/CharacterEff/1112903/0/0#";  //红心
var tz11 = "#fEffect/CharacterEff/1112904/0/0#";  //彩心
var tz12 = "#fEffect/CharacterEff/1112924/0/0#";  //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#";  //蓝星
var tz14 = "#fEffect/CharacterEff/1112926/0/0#";  //红星
var tz15 = "#fEffect/CharacterEff/1112949/0/0#";  //花样音符
var tz16 = "#fEffect/CharacterEff/1112949/1/0#";  //花样音符
var tz17 = "#fEffect/CharacterEff/1112949/2/0#";  //花样音符
var tz18 = "#fEffect/CharacterEff/1112949/3/0#";  //花样音符
var tz19 = "#fEffect/CharacterEff/1112949/4/0#";  //花样音符
var tz20 = "#fEffect/CharacterEff/1114000/1/0#";  //红星花
var yun ="#fUI/UIWindow/PartySearch2/BtNext/mouseOver/0#";////红沙漏
var wn1 = "#fUI/Basic.img/BtClaim/normal/0#";  //警灯
var wn2 = "#fUI/UIWindowTW.img/TimeCapsule/BtClose/disabled/0#";  //叉叉
var wn3 = "#fUI/Basic.img/ComboBox/disabled/1#";  //白条
var wn4 = "#fUI/Basic.img/ComboBox3/mouseOver/1#";  //黄条
var wn5 = "#fUI/Basic.img/Cursor/17/16#";  //黄色圈
var wn6 = "#fUI/Basic.img/Cursor/34/0#";  //圈
var wn7 = "#fUI/Basic.img/Cursor/43/3#";  //蓝圈
var wn8 = "#fUI/CashShop.img/CSBargainSale/BtLeft/normal/0#";  //黄色左
var wn9 = "#fUI/CashShop.img/CSBargainSale/BtRight/normal/0#";  //黄色右
var wn10 = "#fUI/CashShop.img/CSBeauty/tip/hair#";  //发型提示
var wn11= "#fUI/CashShop.img/CSBeauty/hairColor/Enable/0#";  //黑
var wn12 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/1#";  //红
var wn13 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/2#";  //橙
var wn14 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/3#";  //黄
var wn15 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/4#";  //绿
var wn16 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/5#";  //亲
var wn17 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/6#";  //紫
var wn18 = "#fUI/CashShop.img/CSBeauty/hairColor/Enable/7#";  //褐
var wn19 = "#fUI/CashShop.img/CSEffect/event/0#";  //活动图标
var wn20 = "#fUI/CashShop.img/CSEffect/hot/0#";  //人气图标
var wn21 = "#fUI/CashShop.img/CSEffect/mileage/0#";  //积分图标
var wn22 = "#fUI/CashShop.img/CSEffect/new/0#";  //新品图标
var wn23 = "#fUI/CashShop.img/CSEffect/sale/0#";  //折扣图标
var wn24 = "#fUI/CashShop.img/CSEffect/time/0#";  //限量图标
var wp110 = "#fUI/CashShop.img/CSEffect/number/0#";  //数字 后面改数字0-9
var wp111 = "#fUI/CashShop.img/CSEffect/number/1#";  //数字 后面改数字0-9
var wp112 = "#fUI/CashShop.img/CSEffect/number/2#";  //数字 后面改数字0-9
var wp113 = "#fUI/CashShop.img/CSEffect/number/3#";  //数字 后面改数字0-9
var wp114 = "#fUI/CashShop.img/CSEffect/number/4#";  //数字 后面改数字0-9
var wp115 = "#fUI/CashShop.img/CSEffect/number/5#";  //数字 后面改数字0-9
var wp116 = "#fUI/CashShop.img/CSEffect/number/6#";  //数字 后面改数字0-9
var wp117 = "#fUI/CashShop.img/CSEffect/number/7#";  //数字 后面改数字0-9
var wp118 = "#fUI/CashShop.img/CSEffect/number/8#";  //数字 后面改数字0-9
var wp119 = "#fUI/CashShop.img/CSEffect/number/9#";  //数字 后面改数字0-9
var wp2 = "#fUI/CashShop.img/CSIcon/0#";  //男图标 0男-1女
var wp3 = "#fUI/CashShop.img/CSStatus/BtCharge/mouseOver/0#";  //充值图标
var wp4 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/0#";  //武器开头
var wp5 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/1#";  //帽子
var wp6 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/2#";  //披风
var wp7 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/3#";  //长袍
var wp8 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/4#";  //上衣
var wp9 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/5#";  //裤子
var wp10 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/6#";  //鞋子
var wp11 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/7#";  //手套
var wp12 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/8#";  //饰品
var wp13 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/9#";  //眼饰
var wp14 = "#fUI/CashShop.img/CSSubTabBar/Tab/4/Disable/10#";  //效果结尾
var wp15 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/0#";  //斜线美化
var wp16 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/1#";  //斜线美化
var wp17 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/2#";  //斜线美化
var wp18 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/3#";  //斜线美化
var wp19 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/4#";  //斜线美化
var wp20 = "#fUI/mapleBingo.img/mapleBingo/lineAni/0/5#";  //斜线美化
var wi1 = "#fUI/SoulUI.img/DungeonMap/icon/dungeonItem/0#";  //星星图标
var wi2 = "#fUI/SoulUI.img/DungeonMap/icon/soulFragment/0#";  //菱形图标
var wi3 = "#fUI/SoulUI.img/DungeonMap/icon/soulTrap/0#";  //骷髅图标
var wi4 = "#fUI/SoulUI.img/DungeonMap/icon/warpGate/0#";  //圆点图标
var wi5 = "#fUI/SoulUI.img/DungeonParty/backgrnd2#";  //毛莫
var wi6 = "#fUI/StarCityUI.img/Board_Friend/list/0/5/selected#";  //剪刀石头布
var wi7 = "#fUI/StarCityUI.img/Board_GameRank/tab/enabled/0#";  //游戏排行
var wi8 = "#fUI/StarCityUI.img/Board_GameRank/user/myrank#";  //黄色条
var wi9 = "#fUI/StarCityUI.img/Board_GameRank/user/shining#";  //紫色条
var wi11 = "#fUI/UIPVP.img/ChampionMark/4#";  //徽章黄色
var wi12 = "#fUI/UIPVP.img/DmgEffect/DmgRed/excellentCritical#";  //特别危险蓝//"+wp110+""+wp111+""+wp112+""+wp113+""+wp114+""+wp115+""+wp116+""+wp117+""+wp118+""+wp119+"
var wi13 = "#fUI/UIPVP.img/DmgEffect/DmgBlue/excellentCritical#";  //特别危险绿
var wi14 = "#fUI/UIPVP.img/MiniMapIcon/star#";  //黄星星
var wi15 = "#fUI/UIToolTip.img/Item/Equip/Star/Star1#";  //蓝星星
var wn60 = "#fMob/0100101.img/die1/1#";  //蜗牛
//var sl1 = 5000;//兑换数量
var icon3 = "#fUI/GuildBBS/GuildBBS/Emoticon/Cash/7#";//发呆
var icon4 = "#fUI/GuildBBS/GuildBBS/Emoticon/Cash/6#";//愤怒
var icon5 = "#fUI/GuildBBS/GuildBBS/Emoticon/Cash/3#";//大笑
var icon6 = "#fUI/GuildBBS/GuildBBS/Emoticon/Cash/1#";//大笑

var status = 0;
var choose = 0;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1) status++;
        if (status == 0) {


            var text = "\r\n亲爱的#r#h ##k您好，请选择你需要的功能！\r\n\r\n";
            text += "#r#L3#" + yun + " 余额抽奖 #l\r\n";
           //text += "#b#L2#" + yun + " 重置BOSS #n#l\r\n";
          //text += "#d#L6#" + yun + " 办理理财 #l\r\n";
            //text += "#k#L11#" + yun + " 一键蜡笔 #l\r\n";
   //text += "#k#L12#" + yun + " 转身脱胎 #l\r\n";
         // text += "#k#L13#" + yun + " 测试专用 #l\r\n";
        // text += "#d#L10#" + yun + " ( #r注意：每个玩家只能领一次！#k) #n#l\r\n\r\n\r\n\r\n";
          // text += "#d#L8#" + yun + " 在线奖励 #l\r\n\r\n\r\n\r\n";
           //text += "#b#L7#" + wi1 + " 累计充值奖励（#r#z2048717# #v2048717##b） #l\r\n\r\n\r\n\r\n";
          // text += "#d#L3#" + c + " 我要仍物 #l\r\n";
      //  text += "#r#e#L5#" + c + " 我要点卷#l#n\r\n\r\n\r\n";
         //  text += "\r\n#L11#" + yun + " #e#r进入商城#k#l";
          // text += "  " + yun4 + "\r\n";
           //text += "#r#e#L4#" + wn1 + " 新人指导 — 必看！\r\n";
           //text += "#r#L5##r" + yun1 + " 我要用1张#v4002000#兑换5E金币#l\r\n";
			
            cm.sendSimple(text);

        } else if (status == 1) {
           
			switch(selection){
				case 1:
            if (cm.getPlayer().getMapId() >= 910000000 && cm.getPlayer().getMapId() <= 910000022) {
                cm.sendOk("您已经在市场了，还想做什么？");
            } else {
                cm.saveReturnLocation("FREE_MARKET");
                cm.warp(910000000, "st00");
            }
            cm.dispose();		
            break;
				case 2:
			        cm.dispose();
			        cm.openNpc(9900000,"fulidian");	
                                break;
				case 11:
			        cm.dispose();
			        cm.openNpc(9900000,"ceshi2");	
                                break;
				case 12:
			        cm.dispose();
			        cm.openNpc(9900000,"ceshi3");	
                                break;
				case 13:
			        cm.dispose();
			        cm.openNpc(9900000,"ceshi4");	
                                break;
				case 6:
			        cm.dispose();
			        cm.openNpc(9900005,"ceshi");	
                                break;
				case 3:
			        cm.dispose();
			        cm.openNpc(9010017,"ceshi1");	
                                break;
				case 8:
			        cm.dispose();
			        cm.openNpc(9010017,"Onlinebonus");	
                                break;
				case 10:
			        cm.dispose();
			        cm.openNpc(9010017,"kf");	
                                break;
				case 11:
			        cm.dispose();
			        cm.enterCS();	
                                break;
				case 7:
			        cm.dispose();
			        cm.openNpc(9010017,"leijisong");
                      // cm.sendOk("#d注意：1个物品占一个格子，有足够空间在领取！");
                                break;
				case 4:
			        cm.dispose();
			        cm.sendOk("          #e#r新人手册 - 请务认真必看完#n#b\r\n\r\n" + wn11 + " 【新人奖励】聊天窗口输入@npc 打开拍卖，点新手必看\r\n   #r1.#d领取出生礼包 #r2.#d等级奖励 #r3.#d等级装备请看说明操作！\r\n" + wn11 + " #b【装备获取】打开拍卖,有个兑换武器NPC打开它！#d\r\n #r兑换武器：#d按要求换取低级贝勒,135级布莱克缤，150级法弗纳武器(#k每日签到可以获得春节币，还有在线奖励可以获得!#d)!\r\n #r制作装备：#d140~150级防具武器制作方法，找市场石像NPC\r\n" + wn11 + " #b【赚取金币】自由市场，找相框NPC【彩妆】查看！\r\n   #d需要1个绿水灵邮票可换取1亿金币，蜈蚣爆！\r\n" + wn11 + " #b【赚取点卷】赚取点卷方法很多，请看下面！\r\n#r1.#d市场石像，物品赚点 #r2.#d市场石像，官方认证 每天可以领取10000点卷 #r3.#d市场 KIN 抢楼获得 #r4.#d仓库上面NPC，快乐圣诞一次获得5000点卷一天一次 #r5.#r#e打开拍卖，在线时间奖励360分钟可以获得2W点卷,720分钟3W点卷！#n\r\n" + wn11 + " #b【签到系统】屏幕左边黄色星星图标打开，点里面的每日签到活动参加\r\n #r1.#d每天可以领取不同的物品，一共28天奖励！\r\n\r\n\r\n\r\n\r\n");
                                break;
				case 5:
cm.dispose();
                cm.addHyPay(-sl1 * 1);
                 cm.gainNX(1, 1000000);

		    cm.worldSpouseMessage(0x05,"[免费点卷] "+ cm.getChar().getName() + " 玩家在拍卖NPC领取了100W点卷.");
//cm.playerMessage(1, "恭喜您获得1000余额！");
					break;
			}
			choose = selection;
        } else if (status == 2) {
            switch(choose){
				case 1:
					if(cm.haveItem(4000008, 200)) {
						cm.gainItem(4000008,-200);
						cm.gainMeso(100000000);
                                                cm.playerMessage(1, "恭喜您获得1E金币！");
                             cm.worldSpouseMessage(0x05, "[兑换金币] : 恭喜 " + cm.getChar().getName() + " 在市场相框NPC“憩吧”用200个道符兑换了1E金币");
					}else{
						cm.sendSimple("您背包没有200个#v4000008#");
					}
					cm.dispose();
					break;
				case 2:
					if(cm.haveItem(4000008, 1000)) {
						cm.gainItem(4000008,-1000);
						cm.gainMeso(500000000);
                                                cm.playerMessage(1, "恭喜您获得5E金币！");
                             cm.worldSpouseMessage(0x05, "[兑换金币] : 恭喜 " + cm.getChar().getName() + " 在市场相框NPC“憩吧”用1000个道符兑换了5E金币");

					}else{
						cm.sendSimple("您背包没有1000个#v4000008#");
					}
					cm.dispose();
					break;
				case 3:
					if(cm.haveItem(4002002, 1)) {					
						cm.gainMeso(2000000);
						cm.gainItem(4002002, -1);
                                                cm.playerMessage(1, "恭喜您获得200W金币！");
                             cm.worldSpouseMessage(0x05, "[兑换金币] : 恭喜 " + cm.getChar().getName() + " 在市场相框NPC“憩吧”用1张木妖邮票兑换了200W金币");
					}else{
						cm.sendSimple("您背包没有1张#v4002002#");
					}
					cm.dispose();
					break;
				case 4:
					if(cm.gainMeso(500000000)) {					
						cm.gainMeso(-500000000);
						cm.gainItem(4002000, 1);
                                                cm.playerMessage(1, "恭喜您获得1张蜗牛邮票！");
					}else{
						cm.sendSimple("您背包没有1个#v4002002#");
					}
					cm.dispose();
					break;
				case 5:
					if(cm.haveItem(4002002, 1)) {					
						cm.gainMeso(2000000);
						cm.gainItem(4002002, -1);
					//cm.sendSimple("兑换成功");
                              cm.playerMessage(1, "恭喜您获得200W金币！");
					}else{
						cm.sendSimple("您背包没有1个#v4002002#");
					}
					cm.dispose();
					break;
			}
		}
    }
}
